Bug 551987 – GtkPaned redrawing problem
authorMatthias Clasen <mclasen@redhat.com>
Tue, 16 Sep 2008 04:51:56 +0000 (04:51 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 16 Sep 2008 04:51:56 +0000 (04:51 +0000)
2008-09-16  Matthias Clasen  <mclasen@redhat.com>

        Bug 551987 – GtkPaned redrawing problem

        * gtk/gtkhpaned.c:
        * gtk/gtkvpaned.c: Queue invalidations when the handle is moved
        due to child changes. Patch by Owen Taylor

svn path=/trunk/; revision=21399

ChangeLog
gtk/gtkhpaned.c
gtk/gtkvpaned.c

index e64c1ffb003a7526f1aa76e62f43e8e1f8fe2cd5..ac59e660d2a0c723e3036ad18e5a622bf1ffe887 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-09-16  Matthias Clasen  <mclasen@redhat.com>
+
+       Bug 551987 – GtkPaned redrawing problem
+
+       * gtk/gtkhpaned.c:
+       * gtk/gtkvpaned.c: Queue invalidations when the handle is moved 
+       due to child changes. Patch by Owen Taylor
+
 2008-09-16  Matthias Clasen  <mclasen@redhat.com>
 
        Bug 552001 – gtkimcontextsimple.c: variable is declared at middle of
index 365a53f5600a7791acba8f1f969a0659c76f2c9b..f719d3dfed823eaf8c28ea288fbad0cbea713c45 100644 (file)
@@ -130,6 +130,7 @@ gtk_hpaned_size_allocate (GtkWidget     *widget,
       GtkAllocation child2_allocation;
       GtkRequisition child1_requisition;
       GtkRequisition child2_requisition;
+      GdkRectangle old_handle_pos;
       gint handle_size;
       
       gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
@@ -143,6 +144,8 @@ gtk_hpaned_size_allocate (GtkWidget     *widget,
                                       - 2 * border_width),
                                  child1_requisition.width,
                                  child2_requisition.width);
+
+      old_handle_pos = paned->handle_pos;
       
       paned->handle_pos.x = widget->allocation.x + paned->child1_size + border_width;
       paned->handle_pos.y = widget->allocation.y + border_width;
@@ -164,6 +167,14 @@ gtk_hpaned_size_allocate (GtkWidget     *widget,
          flip_child (widget, &(paned->handle_pos));
        }
       
+      if (GTK_WIDGET_MAPPED (widget) &&
+         (old_handle_pos.x != paned->handle_pos.x || old_handle_pos.y != paned->handle_pos.y ||
+          old_handle_pos.width != paned->handle_pos.width || old_handle_pos.height != paned->handle_pos.height))
+       {
+         gdk_window_invalidate_rect (widget->window, &old_handle_pos, FALSE);
+         gdk_window_invalidate_rect (widget->window, &paned->handle_pos, FALSE);
+       }
+
       if (GTK_WIDGET_REALIZED (widget))
        {
          if (GTK_WIDGET_MAPPED (widget))
index 335d4352da67b80e8a73f8c03727e10eedf63cb0..3b11db6d3471fe12b04a94e4bf796966fd11e293 100644 (file)
@@ -125,6 +125,7 @@ gtk_vpaned_size_allocate (GtkWidget     *widget,
       GtkRequisition child2_requisition;
       GtkAllocation child1_allocation;
       GtkAllocation child2_allocation;
+      GdkRectangle old_handle_pos;
       gint handle_size;
       
       gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
@@ -139,11 +140,21 @@ gtk_vpaned_size_allocate (GtkWidget     *widget,
                                  child1_requisition.height,
                                  child2_requisition.height);
 
+      old_handle_pos = paned->handle_pos;
+
       paned->handle_pos.x = widget->allocation.x + border_width;
       paned->handle_pos.y = widget->allocation.y + paned->child1_size + border_width;
       paned->handle_pos.width = MAX (1, (gint) widget->allocation.width - 2 * border_width);
       paned->handle_pos.height = handle_size;
       
+      if (GTK_WIDGET_MAPPED (widget) &&
+         (old_handle_pos.x != paned->handle_pos.x || old_handle_pos.y != paned->handle_pos.y ||
+          old_handle_pos.width != paned->handle_pos.width || old_handle_pos.height != paned->handle_pos.height))
+       {
+         gdk_window_invalidate_rect (widget->window, &old_handle_pos, FALSE);
+         gdk_window_invalidate_rect (widget->window, &paned->handle_pos, FALSE);
+       }
+
       if (GTK_WIDGET_REALIZED (widget))
        {
          if (GTK_WIDGET_MAPPED (widget))